<?php
require dirname(__FILE__).'/widgetAbstract.php';
require dirname(__FILE__).'/buttonWidget.php';
require dirname(__FILE__).'/genericWidget.php';
require dirname(__FILE__).'/datepickerWidget.php';
require dirname(__FILE__).'/dialogWidget.php';

/**
 * The main class/router of the wrapper
 * 
 * @author Jacek Lukasiewicz jlukasie@gmail.com
 *
 */
class UiWidget {
	
	/**
	 * method responsible for the creation of a specific widget object 
	 * @param string $widget
	 */
	public static function getWidget($widget) {
		if($widget == 'button') {
			$button = new ButtonWidget();
			$button->type = 'button';
			return $button;
			
		} elseif($widget == 'button_link') {
			$button = new ButtonWidget();
			$button->type = 'link';
			return $button;
			
		} elseif($widget == 'button_submit') {
			$button = new ButtonWidget();
			$button->type = 'submit';
			return $button;
			
		} elseif($widget == 'datepicker') {
			$datepicker = new DatepickerWidget();
			return $datepicker;
			
		} elseif($widget == 'dialog') {
			$dialog = new DialogWidget();
			return $dialog;
			
		} else {
			return new GenericWidget($widget);
		}
	}
	
	
}
?>